package com.rran.study.pf4j.config;

import com.rran.study.pf4j.api.LoginExtensionPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * @author shiyu
 * @title: PluginHelper
 * @projectName orchestrator-parent
 * @description: TODO
 * @date 2020/12/95:16 下午
 */
@Component
@DependsOn("pluginManager")
public class PluginHelper {

    @Autowired
    private List<LoginExtensionPoint> loginExtensionPoints;

    @PostConstruct
    public void printBizCodes() {
        System.out.println("=======================================================");
        loginExtensionPoints.stream().forEach(ext -> System.out.println(ext.doLogin()));
        System.out.println("=======================================================");
    }

}
